<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<ui:composition template="PaginaInicio.html.xhtml">
	<ui:define name="content">
	<f:loadBundle basename="resources.Post" var="varsita" />

		<center>
			<h1>
				<h:outputText style="BACKGROUND-COLOR: #c0c0c0;" value="#{varsita.mispost}" />
			</h1>
			<h:form>
				<rich:panel>
					<f:facet name="header">
						<h:outputText value="Lista de Post por Categoria"
							style="color:red"></h:outputText>
					</f:facet>
					<br />
					
					<br />
					<h:outputLabel value="#{varsita.categoriapost}" />
					<h:selectOneMenu value="#{postBean.numeroCategoria}"
						onchange="this.form.submit()">
						<f:selectItems value="#{postBean.listarCategorias}" />
					</h:selectOneMenu>
					<br />
					<br />
					<f:facet name="header">
						<h:outputText value="Mis Post" style="color:red"></h:outputText>
					</f:facet>
					<br />
					<br />
					<rich:dataTable value="#{postBean.listarPostXCategoria}" var="post"
						border="5" columns="2">

						<rich:column>
							<f:facet name="header">
								<h:outputText value="#{varsita.titulo}" />
							</f:facet>
							<h:outputText value="#{post.titulo}" />
						</rich:column>
					
						<rich:column>
							<f:facet name="header">
								<h:outputText value="#{varsita.accion}" />
							</f:facet>

							<h:commandLink value="ver"
								action="#{postBean.metodoPosts(post)}" />
						</rich:column>

					</rich:dataTable>

				</rich:panel>

			</h:form>
		</center>

	</ui:define>
	<ui:define name="footer">
	
	<h:form>
			<center>
			<h5>
				<h:commandLink value="#{varsita.atras}"
					action="PaginaPost.html.xhtml"></h:commandLink>
			</h5>
			</center>
		</h:form>
	</ui:define>
</ui:composition>
</html>